home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / bytesc88.arc / STRRCHR.C < prev    next >
Text File  |  1987-10-04  |  384b  |  16 lines

  1. /*
  2. ** strrchr(s,c) - Search s for rightmost occurrance of c.
  3. ** s      = Pointer to string to be searched.
  4. ** c      = Character to search for.
  5. ** Returns pointer to rightmost c or NULL.
  6. */
  7. strrchr(s, c) char *s, c; {
  8.   char *ptr;
  9.   ptr = 0;
  10.   while(*s) {
  11.     if(*s==c) ptr = s;
  12.     ++s;
  13.     }
  14.   return (ptr);
  15.   }
  16.